Raspberry Pi Measurement Electronics: hardware and software by Magda Yury

Raspberry Pi Measurement Electronics: hardware and software by Magda Yury

Author:Magda, Yury [Magda, Yury]
Language: eng
Format: azw3, epub
Publisher: Yury Magda
Published: 2014-04-06T16:00:00+00:00


Fig.35

Note that the Ready state is latched on each falling edge of CS and will not dynamically update if CS is held low. CS must be toggled high then low to fix the Ready state.

The Python source code for driving that ADC is given in Listing 13.

Listing 13.

import RPi.GPIO as GPIO

CS = 18 # GPIO18 is CS

SDO = 23 # GPIO23 is SDO

SCK = 24 # GPIO24 is SCK

Vref = 3.29 # Vref = 3.29V

GPIO.setwarnings(False);

GPIO.setmode(GPIO.BCM) # using GPIO numbers rather than pin numbers

GPIO.setup(CS, GPIO.OUT) # set GPIO18 as output

GPIO.setup(SDO, GPIO.IN) # set GPIO23 as output

GPIO.setup(SCK, GPIO.OUT) # set GPIO24 as output



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.